<!--
 * @Description: 状态
 * @Author: zzj
 * @Date: 2021-09-26 10:17:03
 * @LastEditors: zzj
 * @LastEditTime: 2021-09-26 15:18:23
-->
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>状态</title>
	<script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.9/vue.js"></script>
	<style>
		#app ul{
			list-style: none;
		}
	</style>
</head>
<body>
	<div id="app">
		<button @click="increase">增加</button>
		<div>{{num}}</div>
		<!-- <div>{{list}}</div> -->
		<div>
			<ul>
				<li v-for="item in list" v-bind:key="item">
					{{item}}
				</li>
			</ul>
		</div>
	</div>
	
	<script>
		let vm = new Vue({
			el:"#app",
			data:{
				num:1,
				list:["tom","larry"]
			},
			methods:{
				increase(){
					this.num++;
					this.list.push(Math.random())
				}
			}
		})
	</script>
</body>
</html>